Repository navigation
ROCMAI-889: make the module-size CI gate blocking - #1010
Conversation
The check passes on main now that the last oversized file is split, so the advisory wrapper in the clippy job (continue-on-error plus the report capture) goes and the step becomes the bare strict command. clippy is a required check and the merge queue runs it, so a file over 1,500 production lines now stops a merge, including two PRs that each pass alone. The failure text gains one remediation line pointing at the split rule in docs/architecture.md, and a test asserts the advice together with the rule it points at. A second test ties the "CI fails on this" wording to the step being the bare command. The docs that described the gate as advisory now say CI blocks and the local hook still only reports. Signed-off-by: Jussi Elo <jussi.elo@amd.com>
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are recorded for the change making CI module-size checks blocking while keeping the local hook advisory.
No open issues 🎉
What changed in this PR
This PR makes the existing 1,500-production-line module-size limit blocking in CI while keeping the local pre-commit hook advisory. The limit and counting rules remain unchanged.
Changes:
- Replaces the advisory CI wrapper with the strict check in the required
clippyjob, including merge-queue runs. - Adds remediation guidance and tests tying the messages to the documented split rule and strict workflow step.
- Updates contributor documentation and help text to distinguish blocking CI enforcement from the advisory local hook.
| File | Description |
|---|---|
xtask/src/module_size.rs |
Updates warning and remediation text; adds documentation and workflow contract tests. |
xtask/src/main.rs |
Clarifies advisory-command help text without changing behavior. |
docs/testing.md |
Documents blocking CI enforcement and the advisory hook. |
docs/architecture.md |
Updates the size-limit policy and removes the transitional exception. |
AGENTS.md |
Aligns contributor guidance with blocking CI enforcement. |
.github/workflows/ci.yml |
Removes the non-blocking wrapper and runs the strict check directly. |
Review effort: Balanced
|
Caution 3 potential secret finding(s) were committed in this pull request. Treat each credential as compromised and revoke or rotate it now, even if a later commit removed it. Deleting the line or force-pushing does not undo the leak: the commits stay reachable from this pull request and from every clone or fork, and automated scanners harvest secrets pushed to public repositories within minutes. If a finding is a test fixture or a false positive, allowlist it in the configuration of the scanner that reported it. Security scan found 3 critical or high finding(s) on lines changed by this pull request
View the security scan run for complete reports. “New” means the finding is located in a changed file on an added or modified line; it is not a base-versus-head findings delta. |
juhovainio
left a comment
There was a problem hiding this comment.
No blocking findings. This reflects a diff read plus the live check status, not a runtime check.
Non-blocking:
- The ROCMAI-889 acceptance criterion asks for a scratch red-then-green CI run with both runs linked in the PR. The PR body says this isn't done yet, so please add it before merge.
- The PR also changes the xtask failure/advisory text and adds 2 tests, which the ticket lists as out of scope. It's small and disclosed, and the limit and counting behavior are unchanged.
- The new CI-step test finds the step in
ci.ymlby string match, so reindenting or renaming the step breaks it. It fails loudly, which is acceptable. - "Security scan / Security scanners" and "Security scan / gitleaks" are failing. They aren't required checks and the diff has nothing secret-like, but they're worth a look.
clippy is a required context and all required checks pass. Docs (AGENTS.md, architecture.md, testing.md, doc comments) are consistent, and the leak scan on the diff is clean.
Closes ROCMAI-889.
What
The
cargo xtask check-module-sizestep in theclippyCI job stops being advisory. Thecontinue-on-errorwrapper, the report capture, the warning annotation and the job summary are gone, and the step is the bare command, so a source file over 1,500 production lines fails the job. The precondition holds: the check passes on main (412 files, none over) now that the last oversized file has been split.clippyis a required check, so no administrator action is needed. Evidence:gh pr checks <pr> --requiredon an open PR listsclippyamong the required contexts (18 of 48 checks). The job has noname:, so the context is exactlyclippy.changesjob setsrusttofilter || forced, the filter step only runs onpull_request, andforced=trueon every other event, so amerge_grouprun executes the step. That is what covers two PRs that each pass alone but together push a file over the limit.docs/architecture.md. The ticket lists changes to the xtask command as out of scope, but a later comment on it asks for this one line of failure text, so it is included here; the check's behavior, limit and counting rules are unchanged.clippyjob fails on it. The local pre-commit hook itself stays advisory; flipping it is a separate change.docs/architecture.md,docs/testing.md,AGENTS.mdand thextaskdoc comment now say CI blocks and the local hook still only reports, and the "files already over the limit are split under their own tickets" sentence is dropped since none is left.Tests
the_failure_text_points_at_a_split_rule_the_document_statesasserts the remediation advice together with the rule it points at: the message namesdocs/architecture.mdand its wording, and the document exists and states the same rule. Shown to fail when the sentence in the document is reworded.the_ci_step_runs_the_strict_check_with_no_non_blocking_wrapperties the "CI fails on this" wording to the step inci.ymlbeing the barecargo xtask check-module-sizewith nocontinue-on-error. Shown to fail whencontinue-on-error: trueis put back.Verification
Run locally:
cargo test -p xtask(767 passed),cargo clippy -p xtask --all-targets -- -D warnings,cargo fmt --all -- --check,cargo xtask check-module-size,cargo xtask check-architecture-doc, and the commit-time hooks (including lychee on the new link indocs/testing.md). I also pushed one real source file past the limit on a scratch edit (not committed): the check exits 1 withcrates/rocm-core/src/confirm.rs: 1768 production lines (268 over)and the remediation line.Not run locally: the full workspace gate (
cargo test --workspace --all-targets,scripts/smoke_local.py), since the change touches onlyxtask, one workflow step and docs; CI carries it. The pre-push hook was skipped on the push.Red then green on CI, both running this workflow: the green run is this PR's own
clippyjob. The red run is a throwaway draft (#1013, closed) that is this branch plus one commit paddingcrates/rocm-core/src/confirm.rswith comment lines past the limit. Itsclippyjob passes the Clippy step and fails the module-size step withcrates/rocm-core/src/confirm.rs: 1769 production lines (269 over)followed by the remediation line.No Gherkin scenario: this is CI plumbing and a dev-tool message (
cargo xtask), notrocmCLI behavior, so nothing a CLI user observes changes.